<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){

  var serverAddress = 'localhost';
  
  $("#loginSubmit").click(function(){
    var request = $.ajax({
        url: "http://" + serverAddress + "/soen-6461-server/login/perform",
        type: "post",
        data : {
				username: $("input[name='username']").val(), 
				password : $("input[name='password']").val()
			}
    });
	
	request.done(function (response, textStatus, jqXHR){
        $('.response').text(JSON.stringify(response));
		
		if(response.code != 100 ) {
			alert("Error");
		}
    });
	
  });
});
</script>
</head>
<body>

<div id="div1"><h2>Login to IQ</h2></div>
<form>
	<label>User Name : </label>
	<input type="text" name="username">
	<br/>
	<label>Password : </label>
	<input type="text" name="password">
	<br/>
	<input id="loginSubmit" type="button" value="Login"/>
</form>

	<textarea class="response"></textarea>

</body>
</html>